﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace PSE.Tools.ProjectDependencyDiscovery.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                System.Console.WriteLine("Invalid number of arguments");
                return;
            }

            string path = Path.GetFullPath(args[0]);

            if (!Directory.Exists(path))
            {
                System.Console.WriteLine("Path doesn't exist");
                return;
            }

            DiscoveryManager dm = new DiscoveryManager();
            dm.DiscoverCompileOrder(dm.GetProjectsFromPath(path)).ForEach(s => System.Console.WriteLine(s));
            //System.Console.Read();
        }
    }
}
